package cn.edu.scau.cmi.xuchuangxiong.client;

import java.util.Scanner;

import cn.edu.scau.cmi.xuchuangxiong.abstractFactory.factory.*;
import cn.edu.scau.cmi.xuchuangxiong.domain.Meat;

public class AbstractFactoryClient {
	public void main() {
		Scanner sc = new Scanner(System.in);
		System.out.println("Wens; Tianbang; Aonong; ");
		System.out.println("Please input what brand you choose :");
		String brandName = sc.nextLine();
		AbstractFactory af = null; 
		if(brandName.equals("Wens")) af = new WensFactory();
		else if(brandName.equals("Tianbang")) af = new TianbangFactory();
		else if(brandName.equals("Aonong")) af = new AonongFactory();
		else System.out.println("Wrong input");
		System.out.println("Please input what meat you buy :");
		String meatName = sc.nextLine();
		Meat meat = af.produce(meatName);
		System.out.println("Your choice is :");
		System.out.print(meat.getType());

	}

}
